<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputLabel value="#{messages.Role}"></h:outputLabel>
        </ui:define>
        <ui:define name="body">
        <h:form styleClass="jsfcrud_list_form">
            <h:inputText value="#{roleinfoController.selected.rolename}" required="true"/>
            <h:commandButton value="#{messages.Create} #{messages.New} #{messages.Role}" action="#{roleinfoController.create()}"/>
        </h:form>
        <h:form id="form" styleClass="jsfcrud_list_form">
            <h:panelGrid columns="1">
                <h:selectOneMenu value="#{roleinfoController.selected}" id="roleSelect" >
                    <f:selectItem itemLabel="#{messages.Please}#{messages.Select}"/>
                    <f:selectItems value="#{roleinfoControllerA.allSet}" var="role" itemLabel="#{messages.getString(role.rolename)}"/>
                    <f:ajax render="resourcesInfo"/>
                </h:selectOneMenu>

                <h:selectManyCheckbox value="#{resourceinfoController.temResourceinfoList}" layout="pageDirection" id="resourcesInfo">
                    <f:selectItems value="#{resourceinfoControllerA.allList}"/>
                </h:selectManyCheckbox>
                <h:commandButton value="#{messages.Alter}" action="#{resourceinfoController.editRoleResource()}"/>
            </h:panelGrid>
        </h:form>
        </ui:define>
    </ui:composition>
</html>
